﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!doctype html>

<html>
<head>
	<title>metrics testing</title>
    <script type="text/javascript">
        var _gaq = _gaq || [];
        var settings = {
            domain: 'website1.apphb.com',
            account: 'UA-29267710-1',
            allowlinker: true
        };
        /*
        _gaq.push(['_setAccount', 'UA-4102833-1']);
        _gaq.push(['_setDomainName', 'fluentscript.com']);
        _gaq.push(['_setAllowLinker', true]);
        _gaq.push(['_trackPageview', '/AprTV1/Page1']);
        */
  </script>
  <script type="text/javascript">      
      (function () {
          var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
          ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

   </script>
   <script type="text/javascript">
       
       function OnPathVisit() {
           var path = document.getElementById("pathName").value;
           FireGa(path, "page1", null);
       }


       function OnPageVisit() {
           var path = document.getElementById("pathName").value;
           var page = document.getElementById("pageName").value;
           FireGa(path, page, null);
       }


       function OnTabVisit() {
           var path = document.getElementById("pathName").value;
           var page = document.getElementById("pageName").value;
           var tab = document.getElementById("tabName").value;
           FireGa(path, page, tab);
       }


       function FireGa(path, page, tab) {
           var view = '/' + path + '/' + page;
           if (tab != null)
               view = view + '/' + tab;
           _gaq.push(['_setAccount', settings.account]);
           _gaq.push(['_setDomainName', settings.domain]);
           _gaq.push(['_setAllowLinker', settings.allowlinker]);
           _gaq.push(['_trackPageview', view]);
       }
   </script>
</head>
<body>  
       Path: <input type="text" value="" id="pathName" /><br />
       Page: <input type="text" value="" id="pageName" /><br />
       Tab:  <input type="text" value="" id="tabName" /><br />
       
       <input type="button" value="Test Path Visit" onclick="OnPathVisit();" /><br />
       <input type="button" value="Test Page Visit" onclick="OnPageVisit();" /><br />       
       <input type="button" value="Test Tab  Visit" onclick="OnTabVisit();" /><br />
</body>
</html>
